package com.guoheng.safe.sys.controller;

import com.guoheng.safe.common.base.Result;
import com.guoheng.safe.sys.dto.basicinfo.BasicInfoDTO;
import com.guoheng.safe.sys.service.BasicInfoService;
import io.swagger.annotations.Api;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.validation.Valid;

/**
 * 类功能描述:　BasicController
 *
 * @author Eternal
 * @date 2019-56-15 14:56
 */
@RestController
@Validated
@Api(value = "企业基础信息")
public class BasicInfoController {

    @Resource
    BasicInfoService basicInfoService;

    @PostMapping(value = "basic/info/query")
    public Result getBasicInfo(){
        return basicInfoService.getBasicInfo();
    }

    @PostMapping(value = "basic/info/add")
    public Result addBasicInfo(@RequestBody @Valid BasicInfoDTO basicInfoDTO){
        return basicInfoService.addBasicInfo(basicInfoDTO);
    }

    @PostMapping(value = "basic/info/update")
    public Result updateBasicInfo(@RequestBody @Valid BasicInfoDTO basicInfoDTO){
        return basicInfoService.updateBasicInfo(basicInfoDTO);
    }

}
